package com.example.services;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class UserService {
    @Value(value = "${demo.user}")
    private String username;

    @Autowired
    private OrderService orderService;

    public String getUsername() {
        return username;
    }

    public Map<String, Integer> listOrderDetails(int idx) {
        return orderService.getUserOrderByIdx(this.getUsername(), idx);
    }
}
